import { Game } from "./Game"
import { SquareGroup } from "./SquareGroup"

export interface IPoint {
    readonly x: number
    readonly y: number
}

export interface IViewer {
    show(): void
    remove(): void
}

/**
 * 形状
 */
export type IShape = IPoint[]

// 游戏状态
export enum GameStatus {
    init,
    playing,
    pause,
    over
}

// 游戏显示者
export interface GameViewer {
    showNext(teris: SquareGroup): void // 我给你一个方块组你去显示
    switch(curTeris: SquareGroup): void
    /**
     * 完成界面初始化
     */
    init(game: Game): void
    showScore(score: number): void
    onGamePause(): void
    onGameStart(): void
    onGameOver(): void
}

// 配置文件接口和类型
interface IPanelSize {
    width: number
    height: number
}
// 下一个宽度
interface INextSize {
    width: number
    height: number
}
// level对象数组接口
interface ILevel {
    score: number
    duration: number
}

export interface IGameConfig {
    panelSize: IPanelSize
    nextSize: INextSize
    level: ILevel[]
}
